import Lab6.Password;
import org.junit.Test;
import static org.junit.Assert.*;

public class PasswordTest {
    @Test
    public void isValid() {
        Password p = new Password("1234");
        assertFalse(p.isValid());
        p.setPassword("A1234");
        assertTrue(p.isValid());
        p.setPassword("a12345");
        assertTrue(p.isValid());
        p.setPassword("bb12345");
        assertTrue(p.isValid());
        p.setPassword("ccc12345");
        assertTrue(p.isValid());
        p.setPassword("dddd12345");
        assertTrue(p.isValid());
        p.setPassword("eeeee12345");
        assertFalse(p.isValid());
        p.setPassword("12345#A%*");
        assertFalse(p.isValid());
        p.setPassword("1235  34");
        assertFalse(p.isValid());
        p.setPassword("AaBbCcDd");
        assertFalse(p.isValid());
        p.setPassword("12345678");
        assertFalse(p.isValid());
        p.setPassword("23a");
        assertFalse(p.isValid());
    }
}
